package MyPassage.model;

import edu.emory.mathcs.backport.java.util.Arrays;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

import java.util.ArrayList;
import java.util.List;

public class Wagon {
    private StringProperty name;
    private IntegerProperty number;
    private List<Product> products;
    private List<Integer> visibleColumns;

    //  Constructor for wagon from DB
    public Wagon(String name, int number, List<Product> products, List<Integer> visibleColumns) {
        this.name = new SimpleStringProperty(name);
        this.number = new SimpleIntegerProperty(number);
        this.products = products;
        this.visibleColumns = visibleColumns;
    }
    //  Constructor for new wagon
    public Wagon(String name, int number, List<Product> products) {
        this(name, number, products, Arrays.asList(new Integer[]{1, 1, 1, 1, 1, 1, 1, 1, 1, 1}));
    }

    public List<Product> getProducts() {
        return products;
    }
    public void setProducts(List<Product> products) {
        this.products = products;
    }

    public String getName() {
        return name.get();
    }
    public StringProperty nameProperty() {
        return name;
    }
    public void setName(String name) {
        this.name.set(name);
    }

    public int getNumber() {
        return number.get();
    }
    public IntegerProperty numberProperty() {
        return number;
    }
    public void setNumber(int number) {
        this.number.set(number);
    }
}
